﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Xiaov.SmartWeb.Application.ZNPT
{
    public partial class iframe : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

  

        protected void Button1_Click1(object sender, EventArgs e)
        {
            string DOCMC = t2.Text;
            string DOTMC = t3.FileName;
            string DOCZQ = t4.Text;

            if (DOCMC != "" && DOTMC != "" && DOCZQ != "")
            {
                string kzm = System.IO.Path.GetExtension(DOTMC).ToLower();//取文件扩展名
                string path = "dot/"  + t3.FileName;//服务器文件的相对路径,并将文件名称修改为当前时间+名称
                string fullpath = MapPath(".") + "/" + path;//服务器文件的绝对路径
                t3.PostedFile.SaveAs(fullpath);//上传文件到绝对路径fullpath，同名文件覆盖，所以文件名很精确

                string sql = string.Format(@"insert into zn_docbm values('{0}','{1}','{2}','{3}')", System.Guid.NewGuid().ToString(), t2.Text, path, t4.Text);

                Maticsoft.DBUtility.DbHelperOra.ExecuteSql(sql.ToString());
            }

            this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, "alert('添加成功!');window.close();window.opener.location.reload();", true); 

        }
    }
}